#define _CRT_SECURE_NO_WARNINGS 1
#include <iostream>
#include <string>
#include <vector>
#include <unordered_map>
#include <algorithm>
using namespace std;

int main() {
    int n;
    cin >> n;
    vector<int> arr;
    for (int i = 0; i < 3 * n; i++)
    {
        int tmp;
        cin >> tmp;
        arr.push_back(tmp);
    }
    sort(arr.begin(), arr.end());
    long long sum = 0;
    for (int i = 3 * n - 2; n > 0 && i >= 0; n--, i -= 2)
    {
        sum += arr[i];
    }
    cout << sum;
    return 0;
}